package com.sunday.common.mongo.study.aggregate;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Arrays;

/**
 * @Description:
 * @Author: zsy
 * @Create: 2023/4/18 21:35
 */
@Document(collection = "newyork")
public class Venue {

    @Id
    private String id;
    private String name;
    private double[] location;

    public Venue(){

    }

    public Venue(String name, double[] location) {
        super();
        this.name = name;
        this.location = location;
    }

    public Venue(String name, double x, double y) {
        super();
        this.name = name;
        this.location = new double[]{x, y};
    }

    public String getName() {
        return name;
    }

    public double[] getLocation() {
        return location;
    }

    @Override
    public String toString() {
        return "Venue [id=" + id + ", name=" + name + ", location="
                + Arrays.toString(location) + "]";
    }
}
